/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { BaseResponse } from '../models/BaseResponse';
import type { BaseResponse_LoginUserVo_ } from '../models/BaseResponse_LoginUserVo_';
import type { BaseResponse_Map_string_object_ } from '../models/BaseResponse_Map_string_object_';
import type { BaseResponse_object_ } from '../models/BaseResponse_object_';
import type { LoginUserDto } from '../models/LoginUserDto';
import type { UserRegisterDto } from '../models/UserRegisterDto';

import type { CancelablePromise } from '../core/CancelablePromise';
import { OpenAPI } from '../core/OpenAPI';
import { request as __request } from '../core/request';

export class UserControllerService {

    /**
     * updateUserAvatar
     * @param avatar avatar
     * @param userId userId
     * @returns BaseResponse OK
     * @returns any Created
     * @throws ApiError
     */
    public static updateUserAvatarUsingPost(
avatar?: string,
userId?: number,
): CancelablePromise<BaseResponse | any> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/api/user/avatar',
            query: {
                'avatar': avatar,
                'userId': userId,
            },
            errors: {
                401: `Unauthorized`,
                403: `Forbidden`,
                404: `Not Found`,
            },
        });
    }

    /**
     * cancelAccount
     * @param userId userId
     * @returns BaseResponse_object_ OK
     * @throws ApiError
     */
    public static cancelAccountUsingDelete(
userId: number,
): CancelablePromise<BaseResponse_object_> {
        return __request(OpenAPI, {
            method: 'DELETE',
            url: '/api/user/cancel/{userId}',
            path: {
                'userId': userId,
            },
            errors: {
                401: `Unauthorized`,
                403: `Forbidden`,
            },
        });
    }

    /**
     * getLoginUser
     * @returns BaseResponse_LoginUserVo_ OK
     * @throws ApiError
     */
    public static getLoginUserUsingGet(): CancelablePromise<BaseResponse_LoginUserVo_> {
        return __request(OpenAPI, {
            method: 'GET',
            url: '/api/user/get/login',
            errors: {
                401: `Unauthorized`,
                403: `Forbidden`,
                404: `Not Found`,
            },
        });
    }

    /**
     * login
     * @param dto dto
     * @returns BaseResponse_Map_string_object_ OK
     * @returns any Created
     * @throws ApiError
     */
    public static loginUsingPost(
dto: LoginUserDto,
): CancelablePromise<BaseResponse_Map_string_object_ | any> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/api/user/login',
            body: dto,
            errors: {
                401: `Unauthorized`,
                403: `Forbidden`,
                404: `Not Found`,
            },
        });
    }

    /**
     * logout
     * @returns BaseResponse OK
     * @returns any Created
     * @throws ApiError
     */
    public static logoutUsingPost(): CancelablePromise<BaseResponse | any> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/api/user/logout',
            errors: {
                401: `Unauthorized`,
                403: `Forbidden`,
                404: `Not Found`,
            },
        });
    }

    /**
     * regist
     * @param dto dto
     * @returns BaseResponse OK
     * @returns any Created
     * @throws ApiError
     */
    public static registUsingPost(
dto: UserRegisterDto,
): CancelablePromise<BaseResponse | any> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/api/user/regist',
            body: dto,
            errors: {
                401: `Unauthorized`,
                403: `Forbidden`,
                404: `Not Found`,
            },
        });
    }

}
